import { Provider } from 'react-redux';
import { BrowserRouter } from 'react-router-dom';
import { ConfigProvider, theme, App as AntdApp } from 'antd';
import '@ant-design/v5-patch-for-react-19';
import zh_cn from 'antd/locale/zh_CN'
import RootRoute from '@/router';
import AuthRoute from '@/router/AuthRoute';
import store from '@/redux';
import dayjs from 'dayjs';
import 'dayjs/locale/zh-cn';

dayjs.locale('zh-cn');

function App() {
  // const { t } = useTranslation();

  return (
    <Provider store={store}>
      <BrowserRouter>
        <ConfigProvider
          locale={zh_cn}
          theme={{
            algorithm: theme.defaultAlgorithm,
          }}
        >
          <AuthRoute>
            <AntdApp>
              <RootRoute />
            </AntdApp>
          </AuthRoute>
        </ConfigProvider>
      </BrowserRouter>
    </Provider>
  );
}

export default App
